//
//  SecondViewController.m
//  07-Block
//
//  Created by 韩旭 on 16/7/22.
//  Copyright © 2016年 lanou. All rights reserved.
//
#import "SecondViewController.h"
#import "FirstViewController.h"
//@class FirstViewController;

@interface SecondViewController ()
@property (nonatomic, strong) UITextField *field;
@property (nonatomic, strong) UIButton *btnBack;
@property (nonatomic, strong) NSArray *arr;

@property (nonatomic, strong) FirstViewController *first;
@end
@implementation SecondViewController
- (void)viewDidLoad {
    [super viewDidLoad];
    self.field = [[UITextField alloc] initWithFrame:CGRectMake(100, 100, 100, 100)];
    _field.text = @"sfd";
    
    _field.backgroundColor = [UIColor orangeColor];
    [self.view addSubview:_field];
    
    self.btnBack = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 110, 110)];
    _btnBack.backgroundColor = [UIColor yellowColor];
    [self.view addSubview:_btnBack];
    [_btnBack addTarget:self action:@selector(addBackWithBtn:) forControlEvents:UIControlEventTouchUpInside];
}
- (NSArray *)arr {
    if (_arr == nil) {
        _arr =
    }
}
- (void)addBackWithBtn:(UIButton *)btn {
//    NSInteger count = self.navigationController.viewControllers.count;
//    NSLog(@"%@", self.navigationController.viewControllers);
//    FirstViewController *first = self.navigationController.viewControllers[count - 2];
//    first.titleTextFiled = @"ffffff";
//    [self.navigationController popViewControllerAnimated:YES];
#warning mark - 触发协议方法 （判断delegate存不存在, 判断签订delegate的类又没有实现协议方法）
    if (self.delegate && [self.delegate respondsToSelector:@selector(secondName:)]) {
        [self.delegate secondName:_field.text];
    }
    [self.navigationController popViewControllerAnimated:YES];
}

@end
